import Vue from 'vue'
//对应你要跳转的组件
//1.导入路由插件
import Router from 'vue-router'

//2.注册路由插件
Vue.use(Router)
const routes=[
    {
        path:'/shangpin',//路由地址
        name:'shangpin',//路由地址的别名
        component:()=>import('../components/shangpin.vue')//对应的组件
    },
    {
        path:'/detail/:id',
        meta:{title:'详情页'},
        component:()=>import('../components/detail.vue')
    },
    {
        path:'/bbt',
        name:'bbt',
        component:()=>import('../components/bbt.vue')//对应的组件
    },
    {
        path:'/dingdan',
        name:'dingdan',
        component:()=>import('../components/dingdan.vue')//对应的组件
    }, {
        path:'/my',
        name:'my',
        component:()=>import('../components/my.vue')//对应的组件
    }
    ,{
        path:'*',
        component:()=>import('../components/NotFound.vue')
    },
]
//3.实例化路由管理对象
export default new Router({
    mode:'history',
    base:process.env.BASE_URL,
    routes
})
